home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue47 / Clinic / Automation / IEBrowsU.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-01-18  |  3.6 KB  |  131 lines

  1. unit IEBrowsU;
  2.  
  3. {$ifdef Windows}
  4.   'This is for Win32 compilers only'
  5. {$endif}
  6. {$ifdef Ver90} { Delphi 2.0x }
  7.   {$define DelphiLessThan3}
  8.   {$define DelphiLessThan4}
  9. {$endif}
  10. {$ifdef Ver93} { C++ Builder 1.0x }
  11.   {$define DelphiLessThan3}
  12.   {$define DelphiLessThan4}
  13. {$endif}
  14. {$ifdef Ver100} { Delphi 3.0x }
  15.   {$define DelphiLessThan4}
  16. {$endif}
  17. {$ifdef Ver110} { C++ Builder 3.0x }
  18.   {$define DelphiLessThan4}
  19. {$endif}
  20.  
  21. interface
  22.  
  23. uses
  24. {$ifdef DelphiLessThan3}
  25.   OleAuto,
  26. {$else}
  27.   ComObj,
  28. {$endif}
  29.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  30.   StdCtrls, ExtCtrls;
  31.  
  32. type
  33.   TForm1 = class(TForm)
  34.     btnAbout: TButton;
  35.     btnEasterEgg: TButton;
  36.     btnWin98: TButton;
  37.     btnBrowse: TButton;
  38.     Label1: TLabel;
  39.     edtURL: TEdit;
  40.     procedure btnBrowseClick(Sender: TObject);
  41.     procedure btnAboutClick(Sender: TObject);
  42.     procedure btnEasterEggClick(Sender: TObject);
  43.     procedure btnWin98Click(Sender: TObject);
  44.   private
  45.     { Private declarations }
  46.   public
  47.     IExplore: Variant;
  48.   end;
  49.  
  50. var
  51.   Form1: TForm1;
  52.  
  53. implementation
  54.  
  55. {$R *.DFM}
  56.  
  57. procedure TForm1.btnBrowseClick(Sender: TObject);
  58. begin
  59.   IExplore := CreateOleObject('InternetExplorer.Application');
  60.   IExplore.Application.Visible := True;
  61.   IExplore.Navigate(edtURL.Text)
  62. end;
  63.  
  64. procedure TForm1.btnAboutClick(Sender: TObject);
  65. begin
  66.   IExplore := CreateOleObject('InternetExplorer.Application');
  67.   IExplore.Application.Visible := True;
  68.   IExplore.Navigate('res://shdocvw.dll/about.dlg')
  69. end;
  70.  
  71. procedure TForm1.btnEasterEggClick(Sender: TObject);
  72. begin
  73.   IExplore := CreateOleObject('InternetExplorer.Application');
  74.   //Don't need this since Easter Egg comes up in a second (visible) window
  75.   //IExplore.Application.Visible := True;
  76.   IExplore.Navigate('res://shdocvw.dll/wcee.htm',
  77.     TargetFrameName := 'TheWCEE')
  78. end;
  79.  
  80. { Windows 98 Easter Egg Instructions
  81.  
  82.   Invoke the Date/Time Properties applet from Control Panel.
  83.   This can be done by invoking Control Panel first, then
  84.   locating the relevant icon and double-clicking it.
  85.   You can also double-click the Clock in your task bar's
  86.   system tray. Alternatively, run one of these command-lines:
  87.  
  88.     COMMAND DATE/TIME
  89.     COMMAND TIMEDATE.CPL
  90.  
  91.   Click on the Time Zone tab
  92.   The next bit relies on some geography knowledge.
  93.   Hold down the Ctrl key and drag Memphis, Egypt and
  94.   drop it on Memphis, Tennessee.
  95.   Now hold down the Ctrl key and drag Memphis, Tennessee and
  96.   drop it on Seattle, USA
  97.  
  98.   If you got the right locations, a window will appear with
  99.   various pictures that come and go, and the credits list
  100.   will scroll by.
  101.  
  102.   There is a soundtrack as well, so turn your speakers up.
  103.  
  104.   You can circumvent all this trickery by making a new
  105.   shortcut on your Windows98 desktop. Make a shortcut with
  106.   a command-line of:
  107.  
  108.     "C:\Windows\Application Data\Microsoft\Welcome\WelData.Exe" You_are_a_real_rascal
  109.  
  110.   Make sure you go back to the properties for this shortcut
  111.   (right-click and choose properties) and set the Run: option
  112.   to say Minimized.
  113.  
  114.   The soundtrack to this Easter Egg is the file
  115.   C:\Windows\Application Data\Microsoft\Welcome\Welcom98.Wav }
  116. procedure TForm1.btnWin98Click(Sender: TObject);
  117. var
  118.   WinDir: array[0..MAX_PATH-1] of Char;
  119.   CmdLine: String;
  120. const
  121.   RelPath = '\Application Data\Microsoft\Welcome\';
  122.   AppName = 'WELDATA.EXE';
  123.   AppParam = 'You_are_a_real_rascal';
  124. begin
  125.   GetWindowsDirectory(WinDir, MAX_PATH);
  126.   CmdLine := Format('"%s%s%s" %s', [WinDir, RelPath, AppName, AppParam]);
  127.   WinExec(PChar(CmdLine), SW_SHOWMINNOACTIVE);
  128. end;
  129.  
  130. end.
  131.